package com.uwlaser.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
import com.uwlaser.base.CommonModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
* @author mx
* @date 2022-08-19
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("spc_main")
public class SpcMain extends CommonModel<SpcMain> implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type= IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "检测项目")
    private String testItem;

    @ApiModelProperty(value = "图类(0-x-R,1-x-s)")
    private String graphType;

    @ApiModelProperty(value = "产品型号")
    private String productCode;

    @ApiModelProperty(value = "产品名称")
    private String productName;

    @ApiModelProperty(value = "班组")
    private String teamGroup;

    @ApiModelProperty(value = "设备")
    private String equipmentCode;

    @ApiModelProperty(value = "工单编号")
    private String workOrderCode;

    @ApiModelProperty(value = "规格上限")
    private String specificationUpperLimit;

    @ApiModelProperty(value = "目标值")
    private String targetValue;

    @ApiModelProperty(value = "规格下限")
    private String specificationFloor;

    @ApiModelProperty(value = "判断规则")
    private String judgeRule;

    @ApiModelProperty(value = "样本容量")
    private Integer capacity;

    @ApiModelProperty(value = "创建人")
    @TableField(fill= FieldFill.INSERT)
    private String createBy;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill= FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新人")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private String updateBy;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "是否自动获取数据")
    private Boolean automatic;

    @ApiModelProperty(value = "获取数量")
    private Integer quantity;

    @ApiModelProperty(value = "名称")
    private String name;

    public void copyFrom(SpcMain source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
